<template>
 <div>
     <table border="1" style="border-collapse:collapse;width:400px;height:300px">
         <tr>
             <th>id</th>
             <th>姓名</th>
             <th>性别</th>
             <th>年龄</th>
             <th>操作</th>
         </tr>
         <tr v-for="(item,index) in arr" :key="item.id">
             <td>{{item.id}}</td>
             <td>{{item.name}}</td>
             <td>{{item.sex}}</td>
             <td>{{item.age}}</td>
             <td>
                 <button @click="edit(item)">编辑</button>
                 <button @click="del(index)">删除</button>
             </td>
         </tr>
     </table>
 </div>
</template>

<script>
export default {
    props:['arr','info'],
    data(){
         return{}
    },
    created(){},
    methods:{
        del(index) {
            this.$emit('delData',index)
        },
        edit(item) {
            this.info.isShow = true
            this.info.isAdd = false
            // 传给user
            this.$emit('sendItem',item)
        }
    },
    components:{}
}

</script>
<style scoped>
</style>